﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectExercise
{
    public partial class Registration : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CheckBoxRequired_ServerValidate(object source, ServerValidateEventArgs e)
        {
            e.IsValid = agreement.Checked;
        }

        protected void submit_Click(object sender, EventArgs e)
        {
            //ValidationSummary.Equals
            string firstName = firstNameText.Text;
            string lastName = lastNameText.Text;
            string title = titleList.Text;
            string gender = genderRadioButton.Text;
            string email = emailText.Text;
            string phone = phoneText.Text;
            string fax = faxText.Text;
            string address1 = address1Text.Text;
            string address2 = address2Text.Text;
            Session["FirstName"] = firstName;
            Session["LastName"] = lastName;
            Session["Title"] = title;
            Session["Gender"] = gender;
            Session["Email"] = email;
            Session["Phone"] = phone;
            Session["Fax"] = fax;
            Session["Address1"] = address1;
            Session["Address2"] = address2;

            Validate("RegistrationGroup");
            if (Page.IsValid)
            {
                Response.Redirect("Summary.aspx");
            }          
        }
    }
}